import React from 'react'
import {useSelector} from 'react-redux';
export default function TodoFooter() {
  //获取 todo 的状态值
  let todo = useSelector(state => state.todo.value);
  return (
    <div className="todo-footer">
      <label>
        <input type="checkbox" />
      </label>
      <span>
        <span>已完成 {todo.filter(item => item.done).length}</span> / 全部 {todo.length}
      </span>
      <button className="btn btn-danger">清除已完成任务</button>
    </div>
  )
}
